<% include ../header.ejs %>

<link rel="stylesheet" href="/stylesheets/app/evaluate/evaluate_servicelist.css">

<header data-am-widget="header" data-am-sticky class="am-header am-header-default" id="appTemplates-Nav">
    <div class="am-header-left am-header-nav">
        <a href='javascript:history.go(-1)' class="">
            <img class="am-header-icon-custom" src="data:image/svg+xml;charset&#x3D;utf-8,&lt;svg xmlns&#x3D;&quot;http://www.w3.org/2000/svg&quot; viewBox&#x3D;&quot;0 0 12 20&quot;&gt;&lt;path d&#x3D;&quot;M10,0l2,2l-8,8l8,8l-2,2L0,10L10,0z&quot; fill&#x3D;&quot;%23fff&quot;/&gt;&lt;/svg&gt;" alt=""/>
        </a>
    </div>

    <h1 class="am-header-title">
        <a href="#title-link" class="" id="Typeface-whitecolor">股票池</a>
    </h1>

    <div class="am-header-right am-header-nav">
        <!--<a href="#user-link" class="">

            <i class="am-header-icon am-icon-save"></i>
        </a>-->
        <% if(role=='0'){ %>
        <a href="/smtool_project/wxapp/stockpoolgroup" class="">

            <i class="am-header-icon am-icon-edit"></i>
        </a>
        <% } %>
        <a href="/smtool_project/wxapp/stockpool/add" class="">

            <i class="am-header-icon am-icon-plus"></i>
        </a>
    </div>
</header>

<div data-am-widget="list_news"
     class="am-list-news am-list-news-default ">
    <!--<div class="am-list-news-hd am-cf">-->
    <!--<h2 class="am-list-item-hd am-g am-div-margin">-->
    <!--<span class="am-u-sm-3">代码</span><span class="am-u-sm-3">卖家</span><span class="am-u-sm-3">目标价</span><span class="am-u-sm-3">时间</span>-->
    <!--</h2>-->
    <!--</div>-->

    <!--<div data-am-widget="titlebar" class="am-titlebar am-titlebar-multi" >-->
        <!--&lt;!&ndash;<h2 class="am-titlebar-title ">&ndash;&gt;-->
            <!--&lt;!&ndash;调入&ndash;&gt;-->
        <!--&lt;!&ndash;</h2>&ndash;&gt;-->

        <!--<nav class="am-titlebar-nav">-->
            <!--<a href="#more" class=""> &raquo;</a>-->
        <!--</nav>-->
    <!--</div>-->
    <div class="am-list-news-bd">
        <ul class="am-list" id="">
            <% mconferencelist.forEach(function(data, key){ %>
            <li onclick="javascript:self.location='../stockpool/stockpooldetail?rowId=<%=data.rowId%>'" class="am-list-item-desced am-list-item-thumbed">
                <div class="am-list-main">

                    <div class="am-list-item-hd am-g am-div-margin">
                        <a class="am-u-sm-9">
                            <h3 class="am-list-item-hd">
                                <% if(data.stockId!=null){ %>
                                    <%= data.stockId.name %> <%= data.stockId.stockCode %>
                                <%}%>


                            </h3>
                        </a>
                        <div class="am-u-sm-3 am-fr">
                            <small class="am-list-item-hd" id="<%=data.rowId%>">
                                <% if(data.stockId!=null){ %>
                                <script type="text/javascript">
                                    $(function () {
                                        $.get("/smtool_project/wxapp/api/stock/getRealPrice?stockCode=<%= data.stockId.stockCode%>",function(repdata,status){
                                            var importPrice = '<%= data.importPrice %>';
                                            var realRate= getRealRate(importPrice,repdata)

                                            $('#<%=data.rowId%>').text(toDecimal(realRate)+"%")
                                            $('#rate<%=data.rowId%>').text(repdata)
                                        });
                                    });

                                    function getRealRate(importPrice,realPrice)
                                    {
                                        return (realPrice-importPrice)*100/importPrice
                                    }

                                    function toDecimal(x) {
                                        var f = parseFloat(x);
                                        if (isNaN(f)) {
                                            return;
                                        }
                                        f = Math.round(x*100)/100;
                                        return f;
                                    }
                                </script>
                                <%}%>
                            </small>
                        </div>
                    </div>
                    <div class="am-list-item-hd am-g am-div-margin">
                        <div class="am-u-sm-9">
                            <small class="am-list-item-hd"><%= (data.createUserId && data.createUserId.name) || '' %> 目标价 <%= data.expectPrice %> <%= data.updateTime %></small>
                        </div>
                        <div class="am-u-sm-3 am-fr">
                            <small class="am-list-item-hd" id="rate<%=data.rowId%>"></small>
                        </div>
                    </div>
                </div>
            </li>
            <% }) %>
        </ul>
    </div>
</div>

<% include ../footer.ejs %>

